<%@page language="java"%>
<%@page contentType="text/html"%>
<%@page import="java.util.*, descriptor.*"%>

<jsp:include page="admin_generic_pre.jsp" >
	<jsp:param name="pagesubtitle" value="Locations List" />
</jsp:include>

<p>
	<form method="POST" action="./admin">
		<jsp:useBean id="allCountries" class="descriptor.CountriesListDescriptor" scope="request" />
		<table>
		<%for (CountryDescriptor country: allCountries.getCountryDescriptors()) {%>
		<tr>
			<td><%=country.getName()%> </td>
			<td>
				<table>
				<%for (CityDescriptor city: country.getCities().getCityDescriptors()) {%>
					<tr>
						<td><%=city.getName()%></td>
						<td><input type="checkbox" name="city_<%=city.getID()%>" /></td>
					</tr>
				<%}%>
				</table>
			</td>
			<td>
				<table>
				<%for (CompanyDescriptor company: country.getCompanies().getCompanyDescriptors()) {%>
					<tr>
						<td><%=company.getName()%></td>
						<td><input type="checkbox" name="company_<%=company.getId()%>" /></td>
					</tr>
				<%}%>
				</table>
			</td>
			<td><input type="checkbox" name="country_<%=country.getID()%>" /></td>
		</tr>
		<%}%>
		</table>
		<input type="hidden" name="action" value="locations_modify" />
		<p><input type="submit" name="delete" value="Delete" /></p>
	</form>
</p>






<!-- PREVIOUS
	<p>
		
		<form method="POST" action="./admin" >
			<table>
				<thead>
					<tr><th>Type</th><th>Firstname</th><th>Name</th><th>Login</th><th>Email</th><th>Select</th></tr>
				</thead>
				<tbody>
				<jsp:useBean id="allUsers" class="descriptor.UsersListDescriptor" scope="request" />
				<%
					for (UserDescriptor ud : allUsers.getUserDescriptors()) {
				%>
					<tr><td><%= ud.getTypeName() %></td><td><%=  ud.getFirstName() %></td><td><%=  ud.getName() %></td><td><%=  ud.getLogin() %></td><td><%= ud.getMail() %></td><td><input type="checkbox" name="user_<%= ud.getUserId() %>"</td></tr>
				<%
					}
				%>
				</tbody>
			</table>
			<input type="hidden" name="action" value="users_modify" />
			<p>
				<input type="submit" name="delete" value="Delete" />
			</p>
		</form>
	</p>
	
-->
<jsp:include page="admin_generic_post.jsp" ></jsp:include>	
